<?php 
if(!check_login()){
	echo "<script>alert('Ban phai dang nhap!');location.href='index.php?act=login';</script>";
	exit();
}
?>

<table style="width: 100%;">
	
	<?php
	$q	=	mysql_query("SELECT * FROM tailieu WHERE t_id=".intval($_SESSION['_user']['id'])." ORDER BY tl_date DESC");
	while($row	=	mysql_fetch_array($q)):
	?>
	<tr>
		<td><a href="index.php?act=view_doc&id=<?php echo $row['tl_id'];?>"><?php echo $row['tl_title'];?></a></td>
		<td><?php echo date('d/m/Y',strtotime($row['tl_date']));?></td>
		<td>Lượt xem:&nbsp;<?php echo $row['luot_xem']?></td>
		<td>Download:&nbsp;<?php echo $row['luot_tai'];?></td>
		<td><a href="index.php?act=update_doc&id=<?php echo $row['tl_id'];?>">Sửa</a></td>
		<td><a>Xóa</a></td>
	</tr>
	<?php 
	endwhile;
	?>
	<tr>
		<td colspan="5"><input onclick="location.href='index.php?act=update_doc';" type="button" value="Thêm mới tài liệu"/></td>
	</tr>
</table>
